package com.yuuzy.mapper;

import com.yuuzy.annotation.AutoFill;
import com.yuuzy.entity.Patient;
import com.yuuzy.entity.PatientImageInfo;
import com.yuuzy.enumeration.OperationType;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PatientImageInfoMapper {
	/**
	 * 新增患者图像信息
	 *
	 * @param patient
	 */
	@Insert("insert into patient_image_info (id,uid,create_time,update_time) values (#{id},#{uid},#{createTime},#{updateTime})")
	@AutoFill(OperationType.INSERT)
	void insertPatientImage(Patient patient);


	/**
	 * 根据id删除患者图像信息
	 *
	 * @param ids
	 */
	void deletePatientImageByIds(List<Integer> ids);

	/**
	 * 更新患者图像信息
	 *
	 * @param patientImageInfo
	 */
	@AutoFill(OperationType.UPDATE)
	void updatePatientImage(PatientImageInfo patientImageInfo);

	/**
	 * 根据id查询患者图像信息
	 *
	 * @param id
	 * @return
	 */
	@Select("select id,uid,this_time_scanpicture,tongue_image,previous_scanpicture,face_image,create_time,update_time " +
			"from patient_image_info " +
			"where id = #{id}")
	PatientImageInfo selectById(Integer id);
}
